export default function(){
	return {
		isFolder : function(node){	
			if (!node) return false;
			if (!_.isArray(node)){
				node = [node]
			}	
			if (node.length > 0){					
				return _.every(node, function(nodeItem){
					if (nodeItem.type !== "cmis:folder"){							
						return false;
					}
					return true;
				})					
			}				
			return false;					
		},
		isDocument: function(node){
			if (!node) return false;
			if (!_.isArray(node)){
				node = [node]
			}	
			if (node.length > 0){					
				return _.every(node, function(nodeItem){
					if (nodeItem.type === "cmis:folder"){							
						return false;
					}
					return true;
				})					
			}				
			return false;	
		},
		isWritable: function(node){	
			if (!node) return false;
			if (!_.isArray(node)){
				node = [node]
			}			
			if (node.length > 0){				
				return _.every(node, function(nodeItem){
					if (nodeItem.permission == 'cmis:all' || nodeItem.permission == 'cmis:write'){							
						return true;
					}				
					return false		
				})					
			}				
			return false;	
		},
		isAdmin: function(node){
			if (!node) return false;
			if (!_.isArray(node)){
				node = [node]
			}
			if (node.length > 0){					
				return _.every(node, function(nodeItem){
					if (nodeItem.permission == 'cmis:all'){							
						return true;
					}						
					return false;													
				})					
			}				
			return false;	
		},
		isSingle: function(node){			
			if (_.isArray(node)){	
				return node.length == 1;
			}
			return false;
		},
		isDrm: function(node){	
			if (!node) return false;
			if (!_.isArray(node)){
				node = [node]
			}
			if (node.length > 0){					
				return _.every(node, function(nodeItem){
					if (nodeItem.objectType == 'smx:drmdoc'){							
						return true;
					}						
					return false;													
				})					
			}
			return false;
		},
		isShow: function(bShow) {
			if (!bShow) {
				return 'hide';
			}
			return '';
		},
	}
}

	